﻿@{
    Layout = null;
}

<!DOCTYPE html>


<html lang="zh-cn" class="login_page">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>房都市 - 经纪人登录</title>

    <!-- Bootstrap基础样式 -->
    <link rel="stylesheet" href="/bootstrap/css/bootstrap.min.css" />
    <!-- 主题样式-->
    <link rel="stylesheet" href="/Content/css/green.css" />
    <!-- tooltip -->
    <link rel="stylesheet" href="/lib/qtip2/jquery.qtip.min.css" />
    <!-- 主要样式 -->
    <link rel="stylesheet" href="/Content/css/style.css" />

    <link rel="stylesheet" href="/Content/css/jquery.inputbox.css" />
    <!-- favicon -->
    <link rel="shortcut icon" href="/Content/fangdushi.ico" />

    <link href='/Content/css/googlefonts/OpenSans.css' rel='stylesheet' type='text/css'>


    <!--[if lte IE 8]>
            <link rel="stylesheet" href="/Content/css/ie.css" />
        <![endif]-->
    <!--[if lt IE 9]>
        <script src="/Scripts/ie/html5.js"></script>
        <script src="/Scripts/ie/respond.min.js"></script>
    <![endif]-->


</head>
<body>
    <div class="login_box">

        <form action="" method="post" id="login_form" style="display:block">
            <div class="top_b">房产经纪人登录</div>
            <div class="alert alert-info alert-login">
                请输入注册的手机号和密码登录
            </div>
            <div class="cnt_b">
                <div class="form-group">
                    <div class="input-group has-feedback" id="divMobile">
                        <span class="input-group-addon input-sm"><i class="glyphicon glyphicon-user"></i></span>
                        <input class="form-control input-sm" type="text" id="txtMobile" name="txtMobile" placeholder="手机号" value="" />
                    </div>
                    <label id="lblMobileStatus" style="color: #C62626; font-weight: bold" class="sr-only">请输入手机号</label>
                </div>
                <div class="form-group has-feedback" id="divPassword">
                    <div class="input-group">
                        <span class="input-group-addon input-sm"><i class="glyphicon glyphicon-lock"></i></span>
                        <input class="form-control input-sm" type="password" id="txtPassword" name="txtPassword" placeholder="密码" value="" />
                    </div>
                    <label id="lblPasswordStatus" style="color: #C62626; font-weight: bold" class="sr-only">请输入密码</label>
                </div>
            </div>
            <div class="btm_b clearfix">
                <button class="btn btn-default btn-sm pull-right" type="button" id="btnLogin">登录</button>
                <span class="link_reg"><a href="/Realtor/Register">没有注册？点此进行注册</a></span>
            </div>
        </form>
        <div id="loginMessageForm" class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h3 class="modal-title">提示信息</h3>
                    </div>
                    <div class="modal-body" id="divLoginMsg">

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
        </div>

        @*<form action="index.php?uid=1&amp;page=dashboard" method="post" id="pass_form" style="display:block">

                <div class="cnt_b">
                    <div class="formRow clearfix">
                        <div class="input-group">
                            <span class="input-group-addon input-sm">@@</span>
                            <input type="text" placeholder="Your email address" class="form-control input-sm" />
                        </div>
                    </div>
                </div>
                <div class="btm_b tac">
                    <button class="btn btn-default" type="submit">Request New Password</button>
                </div>
            </form>*@

       

        @*<div class="links_b links_btm clearfix">
            <span class="linkform"><a href="#pass_form">忘记密码?</a></span>
            <span class="linkform" style="display:none"><a href="#login_form">点此返回登录界面</a></span>
        </div>*@

    </div>

    <script src="/Scripts/jquery.min.js"></script>
    <script src="/Scripts/jquery.actual.min.js"></script>

    <script src="/lib/validation/jquery.validate.js"></script>


    <script src="/Scripts/ie/jquery.placeholder.js"></script>

    <script src="/Scripts/jquery.form.js"></script>


    <script src="/Scripts/json2.js"></script>

    <script src="/bootstrap/js/bootstrap.min.js"></script>

   
    <script>
        $(document).ready(function () {
            $('input, textarea').placeholder();

            document.onkeydown = function (e) {
                var ev = document.all ? window.event : e;
                if (ev.keyCode == 13) {
                    $("#btnLogin").click();
                }
            };

            $("#txtMobile").blur(function () {
                $("#lblMobileStatus").addClass("sr-only");
                $("#divMobile").removeClass("has-error");
            });

            $("#txtPassword").blur(function () {
                $("#lblPasswordStatus").addClass("sr-only");
                $("#divPassword").removeClass("has-error");
            });
            $("#btnLogin").click(function () {
                $("#divMobile").removeClass("has-error");
                $("#divPassword").removeClass("has-error");

                if ($.trim($("#txtMobile").val()) == "") {
                    $("#divMobile").addClass("has-error");
                    $("#lblMobileStatus").removeClass("sr-only");
                    return false;
                }

                if ($.trim($("#txtPassword").val()) == "") {
                    $("#divPassword").addClass("has-error");
                    $("#lblPasswordStatus").removeClass("sr-only");
                    return false;
                }
               

                var options = {
                    cache: false,//
                    type: "POST",//发送方式
                    url: '/Realtor/RealtorLogin',//url地址
                    data: $('#login_form').serialize(),//.serialize()方法将form表单内所有数据组装
                    async: false,//同异步提交
                    error: function (request) {

                    },
                    success: function (date) {
                        var code = date["code"];
                        var msg = date["msg"];
                        $("#divLoginMsg").html("");
                        if (code != 0) {
                            $("#btnLogin").removeAttr("disabled")
                            $("#divLoginMsg").html(msg);
                            $('#loginMessageForm').modal('show');
                        }
                        else {
                            //$('#loginMessageForm').modal('show');
                            //$("#divLoginMsg").html("登录成功！");
                            window.location.href = "/Realtor/Index";
                        }
                    },
                    dataType: "json"
                }
                $("#btnLogin").attr("disabled", "disabled");
                $("#login_form").ajaxSubmit(options);


            });

            //* boxes animation
            form_wrapper = $('.login_box');
            function boxHeight() {
                form_wrapper.animate({ marginTop: (-(form_wrapper.height() / 2) - 24) }, 400);
            };
            form_wrapper.css({ marginTop: (-(form_wrapper.height() / 2) - 24) });
            //$('.linkform a,.link_reg a').on('click', function (e) {
            //    var target = $(this).attr('href'),
            //    target_height = $(target).actual('height');
            //    $(form_wrapper).css({
            //        'height': form_wrapper.height()
            //    });
            //    $(form_wrapper.find('form:visible')).fadeOut(400, function () {
            //        form_wrapper.stop().animate({
            //            height: target_height,
            //            marginTop: (-(target_height / 2) - 24)
            //        }, 500, function () {
            //            $(target).fadeIn(400);
            //            $('.links_btm .linkform').toggle();
            //            $(form_wrapper).css({
            //                'height': ''
            //            });
            //        });
            //    });
            //    e.preventDefault();
            //});
        });

       

    </script>

</body>


</html>
